//
//  ContactUsViewController.m
//  UniversalApp
//
//  Created by 奇林刘 on 2018/12/7.
//  Copyright © 2018 voidcat. All rights reserved.
//

#import "ContactUsViewController.h"

@interface ContactUsViewController ()

@end

@implementation ContactUsViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self loadData];
    self.title = @"联系我们";
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

- (void)loadData {
    NSString *url = [[CYURLUtils sharedCYURLUtils] makeURLWithC:@"app_api" A:@"contact"];
    
    [CYNET POSTv2:url parameters:nil responseCache:^(id responseObject) {
        
    } success:^(id responseObject) {
        NSMutableString *string = [NSMutableString string];
        NSArray *array = responseObject[@"data"];
        for (NSDictionary *dic in array) {
            [string appendString:[NSString stringWithFormat:@"%@\n", dic[@"name"]]];
            [string appendString:[NSString stringWithFormat:@"%@\n", dic[@"c_phone"]]];
            [string appendString:[NSString stringWithFormat:@"%@\n\n\n", dic[@"email"]]];
        }
        UILabel *label = [UILabel label];
        [self.view addSubview:label];
        [label mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.view).offset(50);
            make.left.equalTo(self.view).offset(100);
        }];
        label.numberOfLines = 0;
        label.text = string;
    } failure:^(NSString *error) {
    } hasCache:NO];
}

- (void)createLabels {
    
}


@end
